package com.azdebugit.map;

import java.util.concurrent.ConcurrentHashMap;

public class ConcurrentHashMapTest {

    private static ConcurrentHashMap<Integer, Integer> map = new ConcurrentHashMap<Integer, Integer>();

    public static void main(String[] args) {
        Thread thread1 = new Thread("Thread1") {
            @Override
            public void run() {
                map.put(3, 33);
            }
        };

        Thread thread2 = new Thread("Thread2") {
            @Override
            public void run() {
                map.put(4, 44);
            }
        };

        Thread thread3 = new Thread("Thread3") {
            @Override
            public void run() {
                map.put(7, 77);
            }
        };
        while (thread1.isAlive() || thread2.isAlive() || thread3.isAlive()) {
            System.out.println(map);
        }
    }
}